package vcp.enums;

import vcp.enums.utility.EnumReverser;
import vcp.enums.utility.EnumReverser.IEnumReverser;
/**
 * 
 * @author VCP team
 *<p> enum class for complaints
 */
public enum ComplaintType implements IEnumReverser
{
	CAR_DAMAGE ( "Car damage" ),
	WORKER_BAD_ATTITUDE ( "Worker attitude" );

	private String type;
	/**
	 * class constructor
	 * @param type
	 */
	private ComplaintType ( String type )
	{
		this.type = type;
	}

	@Override
	public String toString ()
	{
		return this.type;
	}
	/**
	 * convert from enum to string
	 * @param key
	 * @return requested enum string
	 */
	public static ComplaintType convert ( String key )
	{
		return EnumReverser.convert(ComplaintType.class, key);
	}
	/**
	 * complaint statuses
	 * @author VCP team
	 *
	 */
	public enum ComplaintStatus implements IEnumReverser
	{
		OPENED ( "Opened" ),
		PENDING ( "Pending" ),
		CLOSED ( "Closed" );

		private final String status;
		/**
		 * sets complaint status
		 * @param status
		 */
		private ComplaintStatus ( String status )
		{
			this.status = status;
		}

		@Override
		public String toString ()
		{
			return this.status;
		}
		/**
		 * converts status to enum
		 * @param key
		 * @return reversed value
		 */
		public static ComplaintStatus convert ( String key )
		{
			return EnumReverser.convert(ComplaintStatus.class, key);
		}
	}
	/**
	 * 
	 * @author VCP team
	 *<p> resolved complaint results enums </p>
	 */
	public enum ComplaintResolve implements IEnumReverser
	{
		NOT_ELIGIBLE ( "Not eligible" ),
		REFUND ( "Refund Acc." );

		private final String resolveType;

		private ComplaintResolve ( String resolveType )
		{
			this.resolveType = resolveType;
		}

		@Override
		public String toString ()
		{
			return this.resolveType;
		}
		/**
		 * converts complaint resolve to specific enum by given id
		 * @param key
		 * @return relevant enum
		 */
		public static ComplaintResolve convert ( String key )
		{
			return EnumReverser.convert(ComplaintResolve.class, key);
		}
	}
}
